// src/dto/shipinleibie.dto.ts
import {
  IsNotEmpty,
  IsNumber,
  IsOptional,
  IsString,
  MaxLength,
} from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class CreateShipinleibieDto {
  @ApiProperty({
    description: '视频类别名称',
    example: '科技科普',
    maxLength: 50,
  })
  @IsNotEmpty({ message: '类别名称不能为空' })
  @IsString({ message: '类别名称必须为字符串' })
  @MaxLength(50, { message: '类别名称不能超过50个字符' })
  leibie: string;

  @ApiProperty({
    required: false,
    description: '备注信息',
    example: '科技类视频分类',
    maxLength: 500,
  })
  @IsOptional()
  @IsString({ message: '备注必须为字符串' })
  @MaxLength(500, { message: '备注不能超过500个字符' })
  beizhu?: string;
}

export class UpdateShipinleibieDto extends CreateShipinleibieDto {
  @ApiProperty({
    description: '记录ID',
    example: 1,
  })
  @IsNotEmpty({ message: 'ID不能为空' })
  @IsNumber({}, { message: 'ID必须为数字' })
  id: number;
}
